package model;

import java.io.Serializable;
import javax.persistence.*;

/**
 * The primary key class for the SUPPLIES database table.
 * 
 */
@Embeddable
public class SupplyPK implements Serializable {
	//default serial version id, required for serializable classes.
	private static final long serialVersionUID = 1L;

	@Column(name="VENDOR_ID")
	private long vendorId;

	@Column(name="MATERIAL_ID")
	private long materialId;

	public SupplyPK() {
	}
	public long getVendorId() {
		return this.vendorId;
	}
	public void setVendorId(long vendorId) {
		this.vendorId = vendorId;
	}
	public long getMaterialId() {
		return this.materialId;
	}
	public void setMaterialId(long materialId) {
		this.materialId = materialId;
	}

	public boolean equals(Object other) {
		if (this == other) {
			return true;
		}
		if (!(other instanceof SupplyPK)) {
			return false;
		}
		SupplyPK castOther = (SupplyPK)other;
		return 
			(this.vendorId == castOther.vendorId)
			&& (this.materialId == castOther.materialId);
	}

	public int hashCode() {
		final int prime = 31;
		int hash = 17;
		hash = hash * prime + ((int) (this.vendorId ^ (this.vendorId >>> 32)));
		hash = hash * prime + ((int) (this.materialId ^ (this.materialId >>> 32)));
		
		return hash;
	}
}